import service from "@/utils/request";

enum API {
    SKULIST = "/admin/product/list/",
    //获取商品详情
    SKUDETAIL = "/admin/product/getSkuById/",
    //下架
    NOTSALE = '/admin/product/cancelSale/',
    //上架
    SALE = '/admin/product/onSale/',
    // 删除SKU
    REMOVESKU = '/admin/product/deleteSku/'
}

//SKU列表接口
export const reqSkuList = (pageNo: number, limit: number) => service.get<any, any>(API.SKULIST + `${pageNo}/${limit}`);
//获取商品详情
export const reqSkuDetail = (skuId: number) => service.get<any, any>(API.SKUDETAIL + skuId);
//下架方法
export const reqNotSale = (skuId: number) => service.get(API.NOTSALE + skuId);
//上架
export const reqSale = (skuId: number) => service.get(API.SALE + skuId);
// 删除SKU
export const reqRemoveSku = (skuId:number)=>service.delete(API.REMOVESKU + skuId);
